<script type="text/javascript">
$(function(){
	//$("#branchNoByStorageList").val(10000000);
	//$("#empNoByStorageList").val(10000000);
	//出入库模式信息加载
	$.get("inventorymanagement/getStorageModeInfo",function(data){
		var contentb="<option value='' selected>请选择</option>";
		var list = data.storageModeInfo;
		for(var i=0;i<list.length;i++){
			console.log("lsit==>"+list[i].storageModeId);
			contentb+="<option value="+list[i].storageModeId+">"
			+list[i].storageModeDesc+"</option>"
		}
			
		
			//全选按钮初始化，如果之前选中了，清除
			$("#storageModeByStorageList").html(contentb);
		});
	
	$.post("inventorymanagement/getUserAndBanch",function(json){
		var activeUser = json.activeUser;
		var userNo=activeUser.userNo;
		var branchNo=activeUser.branchNo;
		$("input[name='empNoByStorageList']").val(userNo);
		$("input[name='branchNoByStorageList']").val(branchNo);	
		var param={"branchNoByStorageList":branchNo};
		$.post("inventoryQueryOfIncomingAndOutRecords/getStorageList",param,getStorageList,"json");
})
	
	$("#queryStorageList").click(function(){
		var dateFrom = $("#storageDateFromByStorageList").val();
		var dateTo = $("#storageDateToByStorageList").val();
		/* if(dateFrom){
			if(!checkDate(dateFrom)){
				alertMsg.warn("请输入8位正确的日期！")
				return false;
			}
		}
		if(dateTo){
			if(!checkDate(dateTo)){
				alertMsg.warn("请输入8位正确的日期！")
				return false;
			}
		} */
		//如果两者都不为空，判断日期大小
		if(dateFrom && dateTo){
			var dateFromInt = new Date(dateFrom);
			var dateToInt = new Date(dateTo);
			console.log("dateFromInt==>"+dateFromInt);
			console.log("dateToInt==>"+dateToInt);
			if(dateFromInt>dateToInt){
				alertMsg.warn("起始日期不能大于终止日期！")
				return false;
			}
		}
		$("input[name='pageNum']").val("1");
	});
});
</script>	
<div class="pageHeader ">
	<form id="pagerForm" method="post" action="inventoryQueryOfIncomingAndOutRecords/getStorageList" class="pageForm required-validate" onsubmit="return validateCallback(this,getStorageList);">
		<input type="hidden" name="pageNum" value="" /> 
		<input type="hidden" name="numPerPage" value="" />
		<!-- <input type="hidden" name="pageCount" value="" /> -->
		<div class="searchBar">
		<div class="row" style="padding: 0 10px;">
				<div class="col-md-4 col-sm-12">
					<p>
					<label>日期(起)：</label>
				<input id="storageDateFromByStorageList" name="storageDateFromByStorageList" class="date validDateFrom" />
					</p>
				</div>
				<div class="col-md-4 col-sm-12">
					<p>
						<label>日期(止)：</label>
				<input id="storageDateToByStorageList" name="storageDateToByStorageList" class="date validDateTo"/>
					</p>
				</div>
			</div>
			<div class="row" style="padding: 0 10px;">
				<div class="col-md-4 col-sm-12">
				<p>
				<label>入库方式：</label>
				<select  id="storageModeByStorageList" name="storageModeByStorageList" >
				</select>
				</p>
				</div>
				<div class="col-md-4 col-sm-12">
					<!-- <p>
					<label>网点号：</label>
				<input id="branchNoByStorageList" name="branchNoByStorageList" readonly="readonly" unselectable="on" value=""/>
					</p> -->
				</div>
			</div>		
			<!-- <div class="row" style="padding: 0 10px;">
				<div class="col-md-4 col-sm-12">
					<p>
				  <label>员工号：</label>
				  <input id="empNoByStorageList" name="empNoByStorageList" readonly="readonly" unselectable="on" value=""/>
					</p>
				</div>
			</div>	 -->		
		<div class="subBar">
			<ul> 
				<li>
					<div class="buttonActive" ><div class="buttonContent" ><button id="queryStorageList" type="submit">查询</button></div></div>
				</li>
			</ul>
		</div>
		</div>
	</form>	
</div>
<div class="pageContent" >
<form method="post" action="" class="pageForm required-validate" onsubmit="return validateCallback(this,printViewPageAjaxDone);" >

		<!-- <input id="bankName" name="bankName" type="hidden" value="">
		<input id="companyName" name="companyName" type="hidden" value=""> -->
	 <div class="panelBar">
			<ul class="toolBar">
				<li><a id="printTable" class="add" onclick="printTableInfo(this);" url="storagelists" name="出入库清单"><span>打印预览</span></a></li>
			</ul>
	 </div>
	 <div id="storagelists">
		<table class="table" width="800" layoutH="320">
			<thead>
				<tr>
					<th width="5%" align="center">序号</th>
					<th width="15%" align="center">出入库单号</th>
					<th width="15%" align="center">出入库方式</th>
					<th width="10%" align="center">出入库日期</th>
					<th width="10%" align="center">网点号</th>
					<th width="15%" align="center">网点名称</th>
					<th width="10%" align="center">员工号</th>
					<th width="15%" align="center">员工姓名</th>
				</tr>
			</thead>
			<tbody id="storageList">
			</tbody>
		</table>
		</div>
</form>
</div>

	



